/***********************************************************************
 * Module:  KhoThanhPham.cs
 * Author:  Tuan Nguyen
 * Purpose: Definition of the Class KhoThanhPham
 ***********************************************************************/

using System;

public class KhoThanhPham
{
   public string TenKho;
   public string DiaChiNv;
   public string DienThoaiKh;
   
   public System.Collections.ArrayList sanPhamTaiQuay;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetSanPhamTaiQuay()
   {
      if (sanPhamTaiQuay == null)
         sanPhamTaiQuay = new System.Collections.ArrayList();
      return sanPhamTaiQuay;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetSanPhamTaiQuay(System.Collections.ArrayList newSanPhamTaiQuay)
   {
      RemoveAllSanPhamTaiQuay();
      foreach (SanPhamTaiQuay oSanPhamTaiQuay in newSanPhamTaiQuay)
         AddSanPhamTaiQuay(oSanPhamTaiQuay);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddSanPhamTaiQuay(SanPhamTaiQuay newSanPhamTaiQuay)
   {
      if (newSanPhamTaiQuay == null)
         return;
      if (this.sanPhamTaiQuay == null)
         this.sanPhamTaiQuay = new System.Collections.ArrayList();
      if (!this.sanPhamTaiQuay.Contains(newSanPhamTaiQuay))
      {
         this.sanPhamTaiQuay.Add(newSanPhamTaiQuay);
         newSanPhamTaiQuay.SetKhoThanhPham(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveSanPhamTaiQuay(SanPhamTaiQuay oldSanPhamTaiQuay)
   {
      if (oldSanPhamTaiQuay == null)
         return;
      if (this.sanPhamTaiQuay != null)
         if (this.sanPhamTaiQuay.Contains(oldSanPhamTaiQuay))
         {
            this.sanPhamTaiQuay.Remove(oldSanPhamTaiQuay);
            oldSanPhamTaiQuay.SetKhoThanhPham((KhoThanhPham)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllSanPhamTaiQuay()
   {
      if (sanPhamTaiQuay != null)
      {
         System.Collections.ArrayList tmpSanPhamTaiQuay = new System.Collections.ArrayList();
         foreach (SanPhamTaiQuay oldSanPhamTaiQuay in sanPhamTaiQuay)
            tmpSanPhamTaiQuay.Add(oldSanPhamTaiQuay);
         sanPhamTaiQuay.Clear();
         foreach (SanPhamTaiQuay oldSanPhamTaiQuay in tmpSanPhamTaiQuay)
            oldSanPhamTaiQuay.SetKhoThanhPham((KhoThanhPham)null);
         tmpSanPhamTaiQuay.Clear();
      }
   }
   public System.Collections.ArrayList chiTietKhoThanhPham;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetChiTietKhoThanhPham()
   {
      if (chiTietKhoThanhPham == null)
         chiTietKhoThanhPham = new System.Collections.ArrayList();
      return chiTietKhoThanhPham;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetChiTietKhoThanhPham(System.Collections.ArrayList newChiTietKhoThanhPham)
   {
      RemoveAllChiTietKhoThanhPham();
      foreach (ChiTietKhoThanhPham oChiTietKhoThanhPham in newChiTietKhoThanhPham)
         AddChiTietKhoThanhPham(oChiTietKhoThanhPham);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddChiTietKhoThanhPham(ChiTietKhoThanhPham newChiTietKhoThanhPham)
   {
      if (newChiTietKhoThanhPham == null)
         return;
      if (this.chiTietKhoThanhPham == null)
         this.chiTietKhoThanhPham = new System.Collections.ArrayList();
      if (!this.chiTietKhoThanhPham.Contains(newChiTietKhoThanhPham))
      {
         this.chiTietKhoThanhPham.Add(newChiTietKhoThanhPham);
         newChiTietKhoThanhPham.SetKhoThanhPham(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveChiTietKhoThanhPham(ChiTietKhoThanhPham oldChiTietKhoThanhPham)
   {
      if (oldChiTietKhoThanhPham == null)
         return;
      if (this.chiTietKhoThanhPham != null)
         if (this.chiTietKhoThanhPham.Contains(oldChiTietKhoThanhPham))
         {
            this.chiTietKhoThanhPham.Remove(oldChiTietKhoThanhPham);
            oldChiTietKhoThanhPham.SetKhoThanhPham((KhoThanhPham)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllChiTietKhoThanhPham()
   {
      if (chiTietKhoThanhPham != null)
      {
         System.Collections.ArrayList tmpChiTietKhoThanhPham = new System.Collections.ArrayList();
         foreach (ChiTietKhoThanhPham oldChiTietKhoThanhPham in chiTietKhoThanhPham)
            tmpChiTietKhoThanhPham.Add(oldChiTietKhoThanhPham);
         chiTietKhoThanhPham.Clear();
         foreach (ChiTietKhoThanhPham oldChiTietKhoThanhPham in tmpChiTietKhoThanhPham)
            oldChiTietKhoThanhPham.SetKhoThanhPham((KhoThanhPham)null);
         tmpChiTietKhoThanhPham.Clear();
      }
   }
   public Kho kho;
   
   /// <pdGenerated>default parent getter</pdGenerated>
   public Kho GetKho()
   {
      return kho;
   }
   
   /// <pdGenerated>default parent setter</pdGenerated>
   /// <param>newKho</param>
   public void SetKho(Kho newKho)
   {
      if (this.kho != newKho)
      {
         if (this.kho != null)
         {
            Kho oldKho = this.kho;
            this.kho = null;
            oldKho.RemoveKhoThanhPham(this);
         }
         if (newKho != null)
         {
            this.kho = newKho;
            this.kho.AddKhoThanhPham(this);
         }
      }
   }

}